local bewater    = require "bw.bewater"
local http_agent = require "bw.server.http_agent"
local log        = require "bw.log"
local sname      = require "sname"
local Hall       = bewater.proxy(sname.HALL)

local M = {
    url = "/center/user/get_value",
    auth = true,
    data = {
        appname = "string?",
        key = "string",
    },
}

function M.handler(_, req, acc)
    local key = req.key
    if req.appname then
        key = req.appname.."_"..req.key
    end
    return {
        value = Hall.get_user_kv(acc, key)
    }
end

http_agent.reg(M)
